1. Field of the Invention
The present invention is directed toward the field of object oriented software systems, and more particularly to an object oriented system that fully integrates relational databases.
2. Art Background
An object oriented approach to programming provides many advantages over traditional procedural programming approaches. For example, an object oriented approach permits code reuse through implementation of inheritance and modularity through implementation of encapsulation. There are many views as to what concepts define object oriented programming, and there are many terms and definitions for defining these concepts. In general, objects incorporate procedures, also called methods or operations, and data, also called attributes or properties. Objects are instantiated from and described by structures known as class types. For purposes of nomenclature, the object oriented programming environment described herein defines classes as class types. A class type is a general abstract specification, and an object instantiated from a class type is a specific concrete instance of the class type.
A class type consists of an interface and an implementation. The interface comprises variables and function declarations, wherein the variables represent the attributes of the class type, and the function declarations specify methods for manipulating those attributes as well as performing other operations. The declaration specifies the name, return type, and argument, known collectively as the signature. The implementation refers to the actual code that implements the methods specified in the interface. Class types may consist of abstract types or implementation types. Objects are not instantiated from abstract types. Instead, objects are instantiated from implementation types.
Object oriented languages, such as the C++ language, permit the creation of special types via inheritance. In general, inheritance is a mechanism for passing attributes and methods from a parent or base type to one or more child or derived types. Inheritance permits code reuse because interfaces and implementations need not be duplicated in the child type. Instead, the interfaces and implementations may be incorporated in any child type through reference to the parent or base type.
In general, objects communicate through message passing mechanisms. An object, known as a client object, may call a method of another object. A client object invokes a method of another object by accessing the object via the defined interfaces. Thus, to invoke a method in an object or to query an object, the client object requires knowledge of the signatures of the methods in the interface of the target object. The client object calls the methods and passes the appropriate parameters. For example, to obtain the value of an attribute in an object, a client object calls a method, via an interface, to obtain the value.
The concept of isolating the implementation of the methods and attributes within an object is known as encapsulation. Encapsulation is a powerful feature of object oriented systems because it separates the external part of an object (e.g., the part exposed to the objects user) from the internal part (e.g., the structure and implementation). Therefore, encapsulation permits changing the object implementation without affecting the interaction with other functions or objects as long as the interface does not change.
In general, databases are used to store data for use by database clients, such as application programs. One type of database used in software systems is a relational database. In general, a relational database stores information in the form of tables. Typically, relational databases include software that permit a user, through use of a query language, to visualize different portions and combinations of these tables.
Object oriented programming environments utilize databases. For example, an object oriented software system uses databases to store instances of objects so that the objects "persist" in the database. Object oriented software systems, which include encapsulated data and methods, do not have a direct counterpart with the relational model. For example, an object may include several attributes, specified by the class type, that define the state of the object at a particular time. To store the attributes of an object, an object oriented concept, in a relational database, a mapping of the attributes of the object to columns and rows in one or more tables is required.
There are several different data stores used in object oriented systems. Typically, the different data stores are not directly compatible in that each data store has specific requirements for executing transactions. Thus, an object oriented system must specifically interface with every different data store used in the system. For example, a client may request a row from a table in a relational data store. However, if there are multiple relational data stores, then each relational data store may require a specific dialect to execute the transaction to obtain the row. Furthermore, in an object oriented system that integrates several different object systems (e.g., an object oriented system that implements foreign objects), each object system must conduct transactions specifically for the target data store.
Some prior art systems contain interfaces to generically access a data store, such as a relational database. For example, the Open Database Connectivity (ODBC) specification sets forth a standard interface to access databases. These standard interfaces provide uniform access to a database so that the object oriented system is not required to retain knowledge of the particular aspects necessary to perform transactions in every data store used in the system. Although such a standard interface simplifies access to data stores, such as relational databases, the standard interfaces still require the client, such as a client in an object oriented system, to have a notion of the relational model (e.g., tables, columns and rows). For example, the standard interface may provide, through a standard access operation, a mechanism that obtains a particular row in a relational table. However, the client in the object oriented system must utilize the relational database in terms of columns and rows. Therefore, it is desirable to integrate relational data stores into an object oriented system without requiring the clients of the object oriented system to retain specific knowledge of the relational model or the particulars of executing transactions in one or more relational data stores.